<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .red{
        background-color: red;
    }
    .blue{
        background-color: blue;
    }
</style>
<body>
    <div id="app">
        <button @click="boo=!boo">蓝</button>
        <div style="width: 200px;height: 200px" :class="{red:boo,blue:!boo}"></div>
    </div>

    <script src="node_modules/vue/dist/vue.js"></script>
    <script>
        var vue = new Vue({
            el: "#app",
            data:{
                boo: true
            }
        });
    </script>

</body>
</html>